fixing my bad code :(