fixed code a little