fixed a bit of lazy coding