various bugs solved